/****************************************************************************************
*                                                                                      *
*                          Projeto BioInfo - Lincs and CIn / UFPE                      *
*                                    07/10/2014                                        *
*																					   *
****************************************************************************************
* Descricao: Arquivo que contem defines e estruturas.                    *
****************************************************************************************
* Responsaveis: Jefferson Ramos (jrla)													   *
*                                                                                      */
/*                                                                                     *
****************************************************************************************/

#ifndef UTILS_HPP_
#define UTILS_HPP_

#define fi(ini,fim) for(i = ini; i < fim; i++)
#define fj(ini,fim) for(j = ini; j < fim; j++)
#define individuals_compare 1 //individuo para debugar

#define QTD_FOR_LINE_INDIVIDUALS 60
#define qtd_nucleotidios 9000000
#define Byte_By_TwoBit 4

#define MASK_NCL1 0x03
#define MASK_NCL2 0x0C
#define MASK_NCL3 0x30
#define MASK_NCL4 0xC0


#define CUSTO_TRACEBACK_MATCH 3
#define CUSTO_TRACEBACK_MISSMATCH -2
#define CUSTO_TRACEBACK_GAP_OPEN -5
#define CUSTO_TRACEBACK_GAP_EXTENSION -2

#define custoIn -1
#define custoRe -1
#define custoMa 1


#define PE_UNROLL()\
	score_diag2 = score_up[0]; \
	score_diag3 = score_up[1]; \
	score_diag4 = score_up[2]; \
	score_left = score_vector[(TAMSEQ + 1)*threadid_ + i]; \
	score_vector[(TAMSEQ + 1)*threadid_ + i - 1] = score_up[3]; \
	score_result = maximum(score_diag1 + custo_diag[0], score_diag2 + custo_diag[1], \
	score_diag3 + custo_diag[2], score_diag4 + custo_diag[3], \
	custo_diag, score_up, score_left, \
	&store_direction); \
	score_diag1 = score_vector[(TAMSEQ + 1)*threadid_ + i]; \
	score_vector[(TAMSEQ + 1)*threadid_ + i] = score_result; \
	mat_direction[(index_byte - 1) + (i - 1)*(TAMSEQ / Byte_By_TwoBit) + matriz_ID_direc] = store_direction.byte;


typedef char TypeIndividuals;
typedef int TypeMat_direction;
typedef char TypeQuery;

struct bit {
	unsigned char nc1 : 2, nc2 : 2, nc3 : 2, nc4 : 2;
};

typedef union MyUnion {
	char byte;
	struct bit bits;
} byte_Union;

using namespace std;

#endif UTILS_HPP_